package com.bhsy.hellobootspring.controller;

import com.bhsy.hellobootspring.model.User;
import com.bhsy.hellobootspring.service.UserService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
public class UserController
{
    @Resource
    private UserService userService;
    public int addUser(User user)
      {
        return userService.addUser(user);
      }
    /*@RequestMapping("/addUser")
    @ResponseBody
    public int addUser(String name,String pw)
      {
        return userService.addUser(new User(name,pw));
      }*/

    public UserService getUserService() {
        return userService;
    }

    public void setUserService(UserService userService) {
        this.userService = userService;
    }
}
